package org.ecbox.sdk.internal.stream;

import org.ecbox.sdk.internal.stream.connect.ConnectionLifeCycleListener;
import org.ecbox.sdk.internal.stream.message.EopCometMessageListener;

/**
 * 
 * @author zhenzi 2011-8-9 上午09:34:24
 */
public interface EopCometStream {

	/**
	 * 设置连接监听
	 * 
	 * @param connectionLifeCycleListener
	 */
	public void setConnectionListener(ConnectionLifeCycleListener connectionLifeCycleListener);

	/**
	 * 设置消息监听
	 * 
	 * @param cometMessageListener
	 */
	public void setMessageListener(EopCometMessageListener cometMessageListener);

	/**
	 * 开启
	 */
	public void start();

	/**
	 * 停止
	 */
	public void stop();

	/**
	 * 在运行期添加新的长连接
	 * 
	 * @param newClient
	 */
	public void addNewStreamClient(EopCometStreamRequest newClient);
}
